home *** CD-ROM | disk | FTP | other *** search
/ Freelog 117 / FreelogNo117-OctobreNovembre2013.iso / Programmation / jedit / jedit5.1.0install.exe / {app} / modes / cplusplus.xml < prev    next >
Extensible Markup Language  |  2013-07-28  |  4KB  |  126 lines

  1. <?xml version="1.0"?>
  2.  
  3. <!DOCTYPE MODE SYSTEM "xmode.dtd">
  4.  
  5. <!-- Extension of c.xml to add C++ specific syntax. -->
  6. <!-- With some Qt keywords added -->
  7. <MODE>
  8.     <PROPS>
  9.         <PROPERTY NAME="commentStart" VALUE="/*" />
  10.         <PROPERTY NAME="commentEnd" VALUE="*/" />
  11.         <PROPERTY NAME="lineComment" VALUE="//" />
  12.         <PROPERTY NAME="wordBreakChars" VALUE=",+-=<>/?^&*" />
  13.  
  14.         <!-- Auto indent -->
  15.         <PROPERTY NAME="indentOpenBrackets" VALUE="{" />
  16.         <PROPERTY NAME="indentCloseBrackets" VALUE="}" />
  17.         <PROPERTY NAME="unalignedOpenBrackets" VALUE="(" />
  18.         <PROPERTY NAME="unalignedCloseBrackets" VALUE=")" />
  19.         <PROPERTY NAME="indentNextLine"
  20.             VALUE="(?!^\s*(#|//)).*(\b(if|while|for)\s*\(.*\)|\b(else|do)\b)[^{;]*$" />
  21.         <PROPERTY NAME="unindentThisLine"
  22.             VALUE="^\s*((.*case\b.*|[\p{Alpha}_][\p{Alnum}_]*)\s*(slots)?:(?!:)).*$" />
  23.         <PROPERTY NAME="electricKeys" VALUE=":" />
  24.     </PROPS>
  25.  
  26.     <RULES
  27.         IGNORE_CASE="FALSE"
  28.         HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
  29.         <EOL_SPAN TYPE="KEYWORD2" AT_WHITESPACE_END="TRUE" DELEGATE="CPP">#</EOL_SPAN>
  30.  
  31.         <IMPORT DELEGATE="LEX"/>
  32.         <IMPORT DELEGATE="CORE"/>
  33.     </RULES>
  34.  
  35.     <!-- Core C++ language -->
  36.     <RULES SET="LEX"
  37.         IGNORE_CASE="FALSE"
  38.         HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
  39.  
  40.         <!-- A hack not to mark namespace qualification like "std::"
  41.             as labels. -->
  42.         <SEQ TYPE="OPERATOR">::</SEQ>
  43.  
  44.         <IMPORT DELEGATE="c::LEX"/>
  45.     </RULES>
  46.  
  47.     <!-- Core C++ language -->
  48.     <RULES SET="CORE"
  49.         IGNORE_CASE="FALSE"
  50.         HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
  51.  
  52.         <IMPORT DELEGATE="c::CORE"/>
  53.  
  54.         <KEYWORDS>
  55.             <KEYWORD3>catch</KEYWORD3>
  56.             <KEYWORD3>class</KEYWORD3>
  57.             <KEYWORD3>const_cast</KEYWORD3>
  58.             <KEYWORD1>delete</KEYWORD1>
  59.             <KEYWORD3>dynamic_cast</KEYWORD3>
  60.             <KEYWORD1>explicit</KEYWORD1>
  61.             <KEYWORD2>export</KEYWORD2>
  62.             <KEYWORD1>friend</KEYWORD1>
  63.             <KEYWORD3>mutable</KEYWORD3>
  64.             <KEYWORD2>namespace</KEYWORD2>
  65.             <KEYWORD1>new</KEYWORD1>
  66.             <KEYWORD3>operator</KEYWORD3>
  67.             <KEYWORD1>private</KEYWORD1>
  68.             <KEYWORD1>protected</KEYWORD1>
  69.             <KEYWORD1>public</KEYWORD1>
  70.             <KEYWORD1>signals</KEYWORD1>
  71.             <KEYWORD1>slots</KEYWORD1>
  72.             <KEYWORD3>reinterpret_cast</KEYWORD3>
  73.             <KEYWORD3>static_assert</KEYWORD3>
  74.             <KEYWORD3>static_cast</KEYWORD3>
  75.             <KEYWORD3>template</KEYWORD3>
  76.             <LITERAL2>this</LITERAL2>
  77.             <KEYWORD1>throw</KEYWORD1>
  78.             <KEYWORD1>try</KEYWORD1>
  79.             <KEYWORD3>typeid</KEYWORD3>
  80.             <KEYWORD3>typename</KEYWORD3>
  81.             <KEYWORD2>using</KEYWORD2>
  82.             <KEYWORD1>virtual</KEYWORD1>
  83.  
  84.         </KEYWORDS>
  85.     </RULES>
  86.  
  87.     <!-- Preprocessor specific rules -->
  88.     <RULES SET="CPP"
  89.         IGNORE_CASE="FALSE"
  90.         HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
  91.  
  92.         <EOL_SPAN_REGEXP HASH_CHAR="include" TYPE="MARKUP" DELEGATE="c::INCLUDE">include\b</EOL_SPAN_REGEXP>
  93.         <EOL_SPAN_REGEXP HASH_CHAR="define" TYPE="MARKUP" DELEGATE="DEFINE">define\b</EOL_SPAN_REGEXP>
  94.         <EOL_SPAN_REGEXP HASH_CHAR="endif" TYPE="MARKUP" DELEGATE="c::LEX">endif\b</EOL_SPAN_REGEXP>
  95.         <EOL_SPAN_REGEXP HASH_CHAR="elif" TYPE="MARKUP" DELEGATE="c::CONDITION">elif\b</EOL_SPAN_REGEXP>
  96.         <EOL_SPAN_REGEXP HASH_CHAR="if" TYPE="MARKUP" DELEGATE="c::CONDITION">if\b</EOL_SPAN_REGEXP>
  97.  
  98.         <IMPORT DELEGATE="LEX"/>
  99.  
  100.         <!-- Directives -->
  101.         <KEYWORDS>
  102.             <MARKUP>ifdef</MARKUP>
  103.             <MARKUP>ifndef</MARKUP>
  104.             <MARKUP>else</MARKUP>
  105.             <MARKUP>error</MARKUP>
  106.             <MARKUP>line</MARKUP>
  107.             <MARKUP>pragma</MARKUP>
  108.             <MARKUP>undef</MARKUP>
  109.             <MARKUP>warning</MARKUP>
  110.         </KEYWORDS>
  111.     </RULES>
  112.  
  113.     <!-- After #define directive -->
  114.     <!-- Almost same as the normal code,
  115.         except two additional operators # and ##. -->
  116.     <RULES SET="DEFINE"
  117.         IGNORE_CASE="FALSE"
  118.         HIGHLIGHT_DIGITS="TRUE" DIGIT_RE="[0-9][0-9a-zA-Z]*">
  119.         <SEQ TYPE="OPERATOR">#</SEQ>
  120.         <IMPORT DELEGATE="LEX"/>
  121.         <IMPORT DELEGATE="CORE"/>
  122.     </RULES>
  123.  
  124. </MODE>
  125.  
  126.